--- /** * Category Archive * * Demonstrates: * - getTerm for fetching taxonomy term details * - getEntriesByTerm for entries with a specific term */ import { getTerm, getEntriesByTerm } from "emdash"; import Base from "../../layouts/Base.astro"; import PostCard from "../../components/PostCard.astro"; const { slug } = Astro.params; const category = await getTerm("categories", slug!); const posts = await getEntriesByTerm("posts", "categories", slug!); if (!category) { return Astro.redirect("/404"); } ---

{category.label}

{ posts.length > 0 ? (
{posts.map((post) => ( ))}
) : (

No posts in this category.

) }